package com.kaifamiao.methods;

public class BusFactoryTest {
    public static void main(String[] args) {
        // 首先创建一个工厂
        BusFactory factory = new BusFactory();

        // 调用工厂中的方法创建Bus实例
        Bus bus = factory.produce();

        System.out.println( bus.brand );
        System.out.println( bus.length + bus.unit );
        System.out.println( bus.width + bus.unit );
        System.out.println( bus.height + bus.unit );

        bus.run();
    }
}
